Skip to content

mipv6: put the Binding Acknowledgement P flag at 0x20 - #1238

Open
adamgeorge309 wants to merge 1 commit into
masterfrom
topic/gy/pmipv6-pba-proxy-flag
Open

adamgeorge309 wants to merge 1 commit into
masterfrom
topic/gy/pmipv6-pba-proxy-flag

Conversation

@adamgeorge309

@adamgeorge309 adamgeorge309 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A Proxy Mobile IPv6 (PMIPv6, RFC 5213) Proxy Binding Acknowledgement carries its Proxy Registration (P) flag at 0x20 of the flags octet, as RFC 5213 Section 10 assigns it. INET wrote and read it at 0x40, the Mobile Router (R) flag of the Network Mobility (NEMO) Basic Support Protocol, RFC 3963. The encode and decode pair agreed, so simulations were unaffected; the bytes on the wire were wrong.

Closes #1237

The problem

src/inet/networklayer/mipv6/MobilityHeaderSerializer.cc:186 (serialize) and :318 (deserialize):

stream.writeByte((ba->getKeyManagementFlag() ? 0x80u : 0)
        | (ba->getProxyRegistrationFlag() ? 0x40u : 0)); // P-flag (RFC 5213)
...
ba->setProxyRegistrationFlag((kFlag & 0x40u) != 0); // P-flag (RFC 5213)

A capture of the local mobility anchor's backhaul in examples/ipv6/pmipv6, dissected by tshark:

Frame Message Wireshark protocol column Flags field Dissected flags
9 Proxy Binding Update MIPv6 (Mobile IPv6) 0xC2 0x00 (16 bits) Acknowledge (A), Home Registration (H), Proxy Registration (P)
10, before Proxy Binding Acknowledgement NEMO 0x40 R set, P clear
10, after Proxy Binding Acknowledgement MIPv6 0x20 P set

The Proxy Binding Update was already right: P = 0x0200 in its 16-bit flags field.

In the receive direction, a NEMO Binding Acknowledgement with the R flag set was decoded as a proxy one, and the deserializer then read proxy options that a NEMO message does not carry.

Architectural surface

Packet content only: the serialized position of one flag in the Binding Acknowledgement. No C++ interface, NED parameter, message field or feature descriptor changes.

Verification

Reproduction, before and after:

cd examples/ipv6/pmipv6
inet -u Cmdenv -c General --sim-time-limit=12s \
  '--*.lma.recordPcap=true' '--*.lma.pcapRecorder[0].pcapFile="lma.pcap"' \
  '--**.fcsMode="computed"' '--**.crcMode="computed"' '--**.checksumMode="computed"'
tshark -r lma.pcap -Y mipv6

New unit test tests/unit/MobilityHeaderSerializer_1.test compares the octet with the RFC layout: a Proxy Binding Acknowledgement serializes its P flag to 0x20, a received 0x20 decodes as the P flag, and a received 0x40 does not. It fails on master and passes with the fix.

All runs use a release build (make MODE=release in the root, then make MODE=release in tests/module/lib, tests/unit/lib and tests/serializer/lib); the test commands pass --no-build. Master has no Proxy Mobile IPv6 module test, and the Mobile IPv6 module tests send no Proxy Binding Acknowledgement, so the focused evidence is the new unit test and the /examples/ipv6/pmipv6/ fingerprint row.

Suites, each run on unmodified master (49e1fa0945) and with this commit:

Command Master This commit
tests/fingerprint: ./fingerprinttest -s -F tyf 1774 run, 0 failures, 62 errors the same, after the ~tND update
tests/module: inet_run_module_tests -m release --no-build -f MIPv6 10 pass, MIPv6_tcp_handover fails the same
tests/serializer: inet_run_serializer_tests -m release --no-build 3 pass, serializer_chunk_roundtrip fails with 60 failed cases the same, the same 60 cases
tests/unit: inet_run_unit_tests -m release --no-build -f MobilityHeaderSerializer_1 fails: serializes 0x40, decodes 0x20 as P clear passes

The commit was also built in debug mode, with make MODE=debug -j4 at the repository root, in tests/module/lib and in tests/unit/lib, exit 0, with no compiler warning in the changed file. On that build cd tests/module && inet_run_module_tests -m debug --no-build -l ERROR -f 'MIPv6|PMIPv6' passes 11 of 11, MIPv6_tcp_handover included, and cd tests/unit && inet_run_unit_tests -m debug --no-build -f MobilityHeaderSerializer_1 passes, both exit 0.

The 62 fingerprint errors are configurations whose optional features are not built (VoipStreamSender, TcpLwip, Z3GateScheduleConfigurator, the OpenSceneGraph visualizer showcases). Both failures also occur on master.

inet_run_statistical_tests -m release -w examples/ipv6/pmipv6, against statistics repository 9ab4c26a45, passes. Gates: check-commits.sh origin/master..HEAD, check-classification.sh origin/master..HEAD, check-source-seals.sh --base origin/master and check-architecture.sh src/inet/networklayer/mipv6 pass. check-naming.sh --base origin/master fails on pre-existing directory names, as on master, and finds no changed NED or MSG file. The unscoped check-architecture.sh and check-interfaces.sh fail with output identical to master's.

Fingerprints: the /examples/ipv6/pmipv6/ fingerprint that hashes packet bytes (~tND) moves from bd46-d85c to db46-aa59, because one octet of each Proxy Binding Acknowledgement changes. The fingerprint of event times, module paths, message lengths and module-supplied extra data (tplx) and the one of event times, node paths and message lengths of packets between nodes (~tNl) are unchanged. The display-string and canvas-figure fingerprint (tyf), which -F tyf skips, already fails on master: ./fingerprinttest -s -m pmipv6 examples.csv gives 05f8-fee3 against the recorded 0277-d784. This commit gives the same value, so the row is left as it is.

Not addressed here

The proxy mobility options after the fixed fields are still written back to back without option type and length octets, so Wireshark ends the dissection in a spurious option. MobilityHeaderSerializer.cc:23 declares this as a modelling simplification.


Devin Review

The Proxy Mobile IPv6 (PMIPv6, RFC 5213) Proxy Registration (P) flag of a
Binding Acknowledgement was written into, and read back from, bit 0x40 of
the flags octet that follows the Status octet. 0x40 is the Mobile Router
(R) flag of the Network Mobility (NEMO) Basic Support Protocol, RFC 3963.
RFC 5213 Section 10 creates the Binding Acknowledgment Flags registry with
the Key Management Mobility Capability (K) flag at 0x80, R at 0x40 and P
at 0x20, and the message diagram of RFC 5213 Section 8.2 shows the same
order: |Status|K|R|P|Reserved|.

The serializer and the deserializer used the same wrong bit, so a round
trip agreed with itself and nothing inside a simulation changed. The octet
on the wire was wrong: Wireshark dissects the local mobility anchor's
Proxy Binding Acknowledgement as a NEMO message with the R flag set and
the P flag clear. In the other direction, a genuine NEMO acknowledgement
(0x40) was read as a proxy one, and the deserializer then read proxy
options that such a message does not carry.

To see it on master, capture the anchor's backhaul and dissect it:

  cd examples/ipv6/pmipv6
  inet -u Cmdenv -c General --sim-time-limit=12s \
    '--*.lma.recordPcap=true' '--*.lma.pcapRecorder[0].pcapFile="lma.pcap"' \
    '--**.fcsMode="computed"' '--**.crcMode="computed"' \
    '--**.checksumMode="computed"'
  tshark -r lma.pcap -Y mipv6

Frame 10, the Proxy Binding Acknowledgement, is listed as NEMO; its flags
octet is 0x40. With this commit it is listed as MIPv6 (Mobile IPv6) and
the octet is 0x20.

The Binding Update side was already right: RFC 5213 Section 10 assigns P
the bit 0x0200 in its 16-bit flags field, which is what the serializer
writes.

MobilityHeaderSerializer_1.test checks the octet against the RFC layout in
both directions, which a round-trip test cannot do.

One octet of every Proxy Binding Acknowledgement changes, so the
fingerprint of examples/ipv6/pmipv6 that hashes packet bytes (~tND) moves,
from bd46-d85c to db46-aa59. The fingerprint of event times, module paths,
message lengths and module-supplied extra data (tplx) and the one of event
times, node paths and message lengths of packets between nodes (~tNl) do
not move: no message length and no transmission time changed. The
statistical test of the example still passes.

Change: src.mipv6.MobilityHeaderSerializer | behavior.change.fix | fingerprint test whatsnew

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mipv6: the Proxy Registration flag of a Binding Acknowledgement is serialized at 0x40, the Mobile Router flag, instead of 0x20

1 participant